package dj.comparator;

import java.util.Comparator;
import java.util.Date;

import dj.pageModel.PtalkContext;

public class TalkContextComparator implements Comparator<PtalkContext> {
	public int compare(PtalkContext o1, PtalkContext o2) {

		Date acceptTime1 = o1.getSendTime();
		Date acceptTime2 = o2.getSendTime(); // 对日期字段进行升序，如果欲降序可采用before方法
		if (acceptTime1.after(acceptTime2)) {
			return 1;
		}

		return -1;
	}
}
